import {createSlice} from "@reduxjs/toolkit";

const countStore = createSlice({
    name: "countStore",
    initialState: {
        count: 0,
    },
    reducers: {
        add(state, action) {
            state.count += action.payload;
        },
        sub(state, action) {
            state.count -= action.payload;
        }
    }
})

export const {add, sub} = countStore.actions

export default countStore.reducer
